<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <button>点击</button>
    <script>
        var btn = document.querySelector('button');
        btn.addEventListener('click', function() {
            //1.记录浏览历史，跟href一样可以实现后退功能(重定向)
            //location.assign('http://www.taobao.com');
            
            //2.不记录浏览历史，不能实现后退功能
            //location.replace('http://www.baidu.com')

            //3.重新刷新页面
            //location.reload()
            //强制重新刷新
            location.reload(true);
        })
    </script>
</body>
</html>